package com.monitor.service;

import java.util.Date;
import java.util.List;

import com.monitor.po.User;
import com.monitor.util.Pager;

public interface UserService {

	/**
	 * 获取用户
	 * 
	 * @param pageSize
	 *            每页显示大小
	 * @param currentPage
	 *            当前页
	 * @return
	 * @throws Exception
	 */
	Pager<User> getUser(int pageSize, int currentPage) throws Exception;

	/**
	 * 添加用户
	 * 
	 * @param phone
	 *            电话号码
	 * @param imei
	 *            Imei码
	 * @param model
	 * @return
	 * @throws Exception
	 */
	void addUser(String phone, String imei, String model) throws Exception;

	/**
	 * 更新用户信息
	 * 
	 * @param user
	 * @throws Exception
	 */
	void updateUser(User user) throws Exception;

	/**
	 * 根据电话号码获取用户信息
	 * 
	 * @param phone
	 * @return
	 * @throws Exception
	 */
	User getUserByPhone(String phone) throws Exception;

	/**
	 * 
	 * @param uid
	 * @return
	 * @throws Exception
	 */
	User getUserById(long uid) throws Exception;

	/**
	 * 删除用户
	 * 
	 * @param uid
	 * @param fileDir
	 *            用户文件存放的根目录
	 * @return
	 * @throws Exception
	 */
	int deleteUserById(long uid, String fileDir) throws Exception;

	/**
	 * 清除无用的数据
	 * 
	 * @return
	 * @throws Exception
	 */
	void clearData() throws Exception;

	/**
	 * 更新短信屏蔽时间
	 * 
	 * @param shielded
	 * @param startTime
	 * @param endTime
	 * @return
	 * @throws Exception
	 */
	int updateSmsShieldedTime(long uid, boolean shielded, Date startTime, Date endTime) throws Exception;

	/**
	 * 获取指定时间内未与服务器通讯的用户
	 * 
	 * @param time
	 * @return
	 * @throws Exception
	 */
	List<User> getUserBySycTime(long time) throws Exception;

}
